home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 6_14.lha / 6_14 / 6_14a.c next >
Text File  |  1993-08-08  |  504b  |  19 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / class complex from section 6.3.1
  6. / rewritten to use member definitions
  7. lass complex
  8.  
  9.    double re, im;
  10. ublic:
  11.    complex(double r, double i = 0) { re=r; im=i; }
  12.    
  13.    complex operator+(complex j);
  14.    complex operator-(complex j);
  15.    complex operator-();
  16.    complex operator*(complex j);
  17.    friend ostream &operator<<(ostream &out, complex j);                // DELETE
  18. ;
  19.